@import "components/common/_variables.scss";

.form {
  &__row {
    margin-bottom: $spacing-l;
    &:last-child {
      margin-bottom: 0;
    }
    &--wrap {
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      & label {
        margin-bottom: 0 !important;
        order: 2;
      }
      & input {
        order: 1;
        margin-right: 10px;
      }
    }
  }
  &__h0n3y {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
  }
  .textfield {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0.75em 1.5em;
    border: 2px solid $color-smooth;
    outline: none;
    font-size: $font-size-base;
    color: $color-main;
    letter-spacing: 0.5px;
    transition: color 300ms ease, border-color 300ms ease;
    appearance: none;

    &::placeholder {
      opacity: 1;
      color: transparentize($color-main, 0.4);
    }

    &:hover {
      border-color: transparentize($color-alt, 0.5);
    }

    &:focus {
      border-color: $color-alt;
      transition-duration: 0ms;

      &::placeholder {
        color: transparentize($color-main, 0.15);
      }
    }

    &--no-border {
      border-color: transparent;
    }

    &.invalid {
      border-color: red;
    }
  }

  .license-checkbox {
    display: flex;
    align-items: flex-start;
  }

  .checkbox {
    position: absolute;
    opacity: 0;
    margin-top: 5px;
    margin-left: 2px;
  }

  .fake-checkbox {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    margin-right: 10px;
    box-sizing: border-box;
    border: 2px solid $color-smooth;
    transition: all .3s;
  }

  .checkbox:checked + .fake-checkbox {
    border-color: #2A5EFF;
    background-color: #2A5EFF;
  }

  .fake-checkbox::before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    opacity: 0;
  }

  .checkbox:checked + .fake-checkbox::before {
    opacity: 1;
  }

  .license-link {
    color: #2A5EFF;
  }

  .label {
    font-size: $font-size-small;
    margin-bottom: $spacing-s;
    display: block;
  }

  .info {
    font-size: $font-size-small;
    margin-top: $spacing-s;
    color: transparentize($color-main, 0.5);
    display: block;
  }

  .invalid-message {
    color: red;
    display: none;
  }

  .active {
    display: block;
  }
}
